/**
 * Created by win7 on 2017/3/16.
 */
import React from "react";
import {Checkbox} from 'antd';
import { hashHistory } from 'react-router';

export default class UserDetail extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            forbidstate:false,
            tableContent:[],
            editState:false
        }
    }
    componentWillMount(){
        this.setState({
            tableContent:this.props.context
        })
    }
    //编辑用户信息
    editUserinfo(){
        this.props.onedit()
    }
    //禁用启用的修改
    handleChange(context,indexnumber){
        this.props.onmodal(context,indexnumber)
    }
    render(){
        return(
            <li className="userManage_li" style={{backgroundColor:'white'}}>
                <div className="userManage_all userManage_title1" >
                    <Checkbox></Checkbox>
                </div>
                <span  className="userManage_title2">{this.state.tableContent.userId}</span>
                <span  className="userManage_title3">{this.state.tableContent.userName}</span>
                <div  className="userManage_title4"><a href="#">{this.state.tableContent.userCompany[0]}</a></div>
                <span  className="userManage_title5">{this.state.tableContent.userPhone}</span>
                <span  className="userManage_title6">{this.state.tableContent.userState}</span>
                <div className="userManage_all userManage_title8">
                    <span onClick={this.editUserinfo.bind(this)}>编辑</span>
                    <span onClick={this.handleChange.bind(this,this.state.tableContent,this.props.indexnumber)}>{this.state.forbidstate?'启用':'禁用'}</span>
                </div>
            </li>
        )
    }
}